<template>
  <div class="project-details-container">
    <el-tabs type="border-card" v-model="tabType" @tab-click="handleClick">
      <el-tab-pane label="公文制度" name="documentsystem">
        <documentsystem/>
      </el-tab-pane>
      <el-tab-pane label="设备档案" name="equipmentarchive">
        <equipmentarchive v-if="isEquipmentarchive"/>
      </el-tab-pane>
      <el-tab-pane label="证照证件" name="certification">
        <certification v-if="isCertification"/>
      </el-tab-pane>
    </el-tabs>
  </div>
</template>

<script>
  import documentsystem from './components/documentsystem'
  import certification from './components/certification'
  import equipmentarchive from './components/equipmentarchive'

  export default {
    name: 'institution',
    components: {
      documentsystem,
      certification,
      equipmentarchive
    },
    computed: {
      roleType() {
        return this.$store.state.user.roleType
      },
      teamId() {
        return this.$store.state.user.teamId
      }
    },
    mounted() {
      // this.fetchData()
    },
    data() {
      return {
        searchFormList: {},
        chartData: {},
        btnType: 1,
        tabType: 'documentsystem',
        isCertification: false, // 用于只一次刷新投标数据
        isEquipmentarchive: false // 用于只一次刷新投标数据
      }
    },
    methods: {
      handleClick(tab, event) {
        this.tabType = tab.name
        if (tab.name === 'certification') {
          this.isCertification = true
        } else if (tab.name === 'equipmentarchive') {
          this.isEquipmentarchive = true
        }
      }
    }
  }
</script>

<style rel="stylesheet/scss" lang="scss" scoped>
  .project-details-container {
    height: calc(100vh - 130px);
    /*padding: 32px;*/
    overflow: auto;
  }
</style>
